{% load i18n %}
{% load static %}

<table class="list" id="id_table_cases" cellspacing="0" cellspan="0">
	<thead>
		<tr>
			<th width="20">
                            <input id="id_check_all_button" type="checkbox" title="{% trans "Select all cases/Select none case" %}" />
			</th>
			<th width="18">
                            <a id="id_blind_all_link" title="{% trans "Expand all cases" %}">
					<img id="id_blind_all_img" src="{% static 'images/t1.gif' %}" border="0" alt="" class="collapse-all">
				</a>
			</th>
                        <th class="widthID">{% trans "Execution ID" %}</th>
                        <th class="widthID">{% trans "Case ID" %}</th>
                        <th>{% trans "Summary" %}</th>
                        <th width="80">{% trans "Tester" %}</th>
                        <th width="80">{% trans "Assignee" %}</th>
                        <th width="140">{% trans "Automated" %}</th>
                        <th width="100">{% trans "Category" %}</th>
                        <th width="50">{% trans "Priority" %}</th>
                        <th width="40">{% trans "Bugs" %}</th>
                        <th width="50" style='text-align:center'>{% trans "Status" %}</th>
                        <th width="65">{% trans "Comments" %}</th>
		</tr>
	</thead>
	<tbody>
		{% for execution, tester, assignee, priority_value, status_name, comments_count in executions %}
		<tr class="{% cycle 'odd' 'even' %} {% ifequal execution.assignee_id user.pk %} mine {% endifequal %}">
			<td>
				<input type="checkbox" name="case_run" value="{{ execution.pk }}" class="caserun_selector" title="Select/Unselect" />
				<input type="hidden" name="case" value="{{ execution.case.pk }}" />
				<input type="hidden" name="case_text_version" value="{{ execution.case_text_version }}" />
			</td>
			<td title="expand test case" class="expandable vmiddle case_title">
				<img class="blind_icon expand" src="{% static 'images/t1.gif' %}" border="0" alt="" />
			</td>
			<td class="case_title expandable">
				<a href="#caserun_{{ execution.pk }}">#{{ execution.pk }}</a>
			</td>
			<td "{{ execution.case_id }}" class="case_title expandable">
				<a href="{% url "testcases-get" execution.case_id %}">{{ execution.case_id }}</a>
			</td>

			<td class="expandable">
				<a id="link_{{ forloop.counter }}" href="#caserun_{{ execution.pk }}" title="Expand test case">{{ execution.case.summary }}</a>
			</td>
			<td>
				{% if tester %}
				<a href="{% url "tcms-profile" tester %}" class="link_tested_by">{{ tester }}</a>
				{% else %}
                                <a class="link_tested_by">{% trans "None" %}</a>
				{% endif %}
			</td>
			<td>
				{% if assignee %}
				<a href="{% url "tcms-profile" assignee %}" class="link_assignee">{{ assignee }}</a>
                                {% else %}{% trans "None" %}{% endif %}
			</td>
			<td class="expandable">{{ execution.case.is_automated }}</td>
			<td class="expandable">{{ execution.case.category }}</td>
			<td class="expandable">{{ priority_value }}</td>
			<td class="expandable"><span id="{{ execution.pk }}_case_bug_count" {% if execution.num_bug %}class="have_bug"{% endif %}>{{ execution.num_bug }}</span></td>
			<td class="expandable center">
				<img border="0" alt="" class="icon_status btn_{{ status_name|lower }}" />
			</td>
			<td><div id="{{ execution.case_id }}_case_comment_count">{% if comments_count %}<img src="{% static 'images/comment.png' %}" style="vertical-align: middle;">{%endif %} <span id="{{ execution.case_id }}_comments_count">{{ comments_count }}</span></div></td>
		</tr>
		<tr class="case_content hide js-details-caserun" style="display: none;">
			<td id="id_loading_{{ execution.case_id }}" class="left_panel" colspan="14">
				<div class="ajax_loading"></div>
			</td>
		</tr>
		{% empty %}
		<tr>
                    <td colspan="13" align="center">{% trans "No execution found" %}</td>
		</tr>
		{% endfor %}
	</tbody>
</table>
